package com.itheima.mall.service.sms;

import com.itheima.mall.api.sms.FlashPromotionSessionServiceApi;
import com.itheima.mall.pojo.sms.SmsFlashPromotionSession;
import com.itheima.mall.vo.R;
import com.itheima.mall.vo.SessionVo;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FlashPromotionSessionService {
    @DubboReference
    FlashPromotionSessionServiceApi sessionServiceApi;
    public void createSession(SmsFlashPromotionSession session) {
        sessionServiceApi.createSession(session);
    }

    public void deleteSession(Integer id) {
        sessionServiceApi.deleteSession(id);
    }

    public R<List<SmsFlashPromotionSession>> getList() {
        R<List<SmsFlashPromotionSession>> list = sessionServiceApi.getList();
        return list;
    }

    public void updateStatus(Integer id, Integer status) {
        sessionServiceApi.updateStatus(id,status);
    }

    public void updateSession(SmsFlashPromotionSession session) {
        sessionServiceApi.updateSession(session);
    }

    public SmsFlashPromotionSession getSession(Integer id) {
        SmsFlashPromotionSession session = sessionServiceApi.getSession(id);
        return session;
    }

    public List<SessionVo> selectList(Integer flashPromotionId) {
        List<SessionVo> list = sessionServiceApi.selectList(flashPromotionId);
        return list;
    }
}
